package com.ruoyi.manage.controller;

import com.ruoyi.common.core.cg.dto.LeaderDto;
import com.ruoyi.common.core.cg.pojo.Leader;
import com.ruoyi.common.core.cg.result.Result;
import com.ruoyi.manage.service.LeaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 马景昌
 * @create 2025/03/11
 * @description
 */
@RestController
@RequestMapping("/leader")
public class LeaderController {
    @Autowired
    private LeaderService leaderService;

    @GetMapping("/PageShow")
    public Result pageShow(Leader leader) {
        return leaderService.pageShow(leader);
    }
//    查询回显
    @GetMapping(value = "/{id}")
    public Result info(@PathVariable("id") Integer id){
        Result info = leaderService.info(id);
        return info;
    }
//    修改
    @PutMapping("/put")
    public Result put(@RequestBody LeaderDto leader){
        Result result = leaderService.put(leader);
        return result;
    }
//    查询全部leader
    @GetMapping("/show")
    public Result show(){
        Result result = leaderService.show();
        return result;
    }

//    查询负责人全部的手机号码
    @GetMapping("/showPhone")
    public Result showPhone(){
        Result result = leaderService.showPhone();
        return result;
    }
//    查询负责人全部的身份证
    @GetMapping("/showIdCard")
    public Result showIdCard(){
        Result result = leaderService.showIdCard();
        return result;
    }
}
